<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    .box{
      width:1000px;
      height:600px;
      border:2px solid pink;
      margin:100px auto;
      display:flex;
      /* flex-direction: row;
      flex-wrap: wrap; */
      flex-flow:row wrap;
      /* align-content:flex-start; */
      /* align-content:flex-end; */
      /* align-content:center; */
      /* align-content:space-around; */
      /* align-content:space-between; */
      /* align-content: stretch; */
      
    }
    .box div{
      width:250px;
      height:200px;
    }
    /*order控制子元素的排列顺序，正序方式排列，从小到大 数值越小越往前
 */
    .box div:nth-child(1){
      background-color: #f0f;
      order:1;
    }
    .box div:nth-child(2){
      background-color: #ff0;
    }
    .box div:nth-child(3){
      background-color: #f00;
    }
    .box div:nth-child(4){
      background-color: #0f0;
      order:-1;
    }
    .box div:nth-child(5){
      background-color: #00f;
    }
    .box div:nth-child(6){
      background-color: purple;
    }
    .box div:nth-child(7){
      background-color: pink;
      order:-2
    }
  </style>
</head>
<body>
  <div class="box">
    <div>1</div>
    <div>2</div>
    <div>3</div>
    <div>4</div>
    <div>5</div>
    <div>6</div>
    <div>7</div>
  </div>
</body>
</html>